home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3801 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: sourcery.han.de!not-for-mail
  2. Newsgroups: comp.sys.amiga.programmer
  3. References: <19960223.7D2BD90.9087@mojaveg.ridgecrest.ca.us>
  4. From: "Olaf Barthel" <olsen@sourcery.han.de>
  5. Date: Sat, 24 Feb 1996 14:56:37 +0100
  6. X-NewsReader: IntuiNews 1.3a (7.9.95)
  7. Subject: Re: FLOOD() questions
  8. Message-ID: <13213653@sourcery.han.de>
  9.  
  10. In Article <19960223.7D2BD90.9087@mojaveg.ridgecrest.ca.us>, Everett M. Greene <mojaveg@ridgecrest.ca.us> wrote:
  11. > I've been experimenting with the Flood() graphics operation
  12. > and am finding much ambiguity in the RKM explanation.  I've
  13. > included an excerpt of the code I've tried (which doesn't
  14. > work).
  15. >
  16. > void do_window_magic(struct Window *wp)
  17. > {
  18. >   ULONG   tmp_size;
  19. >   PLANEPTR  plane;
  20. >   struct TmpRas  tr;
  21. >
  22. >   tmp_size = RASSIZE(wp->Width, wp->Height) * wp->WScreen->BitMap.Depth;
  23. >   if (plane = AllocRaster(wp->Width, wp->Height)) {
  24. >     InitTmpRas(&tr, plane, tmp_size);
  25. >     wp->RPort->TmpRas = &tr;
  26. >     Flood(wp->RPort, 1, wp->BorderLeft + 1, wp->BorderTop + 1);
  27. >     FreeRaster(plane, wp->Width, wp->Height);
  28. >   }
  29. > }
  30. >
  31. > Questions:
  32. >
  33. > 1. How does the size computed by RASSIZE compare to that
  34. >    generated by AllocRaster() from its width and height
  35. >    parameters?
  36.  
  37.    This has never been set in stone. While you cannot assume that the number
  38. of bytes AllocRaster() allocates will match what the RASSIZE macro tells you,
  39. you can be certain that the size it returns will be suitable for initializing
  40. the TmpRas with.
  41.  
  42. > 2. Does AllocRaster() allocate CHIP memory?
  43.  
  44.    Let's put it this way, AllocRaster() will return memory that can be used
  45. for operating system usage. This means, you will be able to feed the result
  46. into BitMaps and get something out of them (RasInfo, Layer, RastPort, etc.).
  47. I wouldn't bet on getting chip memory, though.
  48.  
  49. > 3. Do you have to AllocRaster() for each bit plane or will
  50. >    one allocation suffice for the whole temp raster?
  51.  
  52.    One (1) plane is sufficient.
  53.  
  54. > 4. If one is flooding within a window, does the temp raster
  55. >    need to be any larger than the window?  [The RKM says
  56. >    something about making the temp raster the same size as
  57. >    the screen which would seem unnecessary.]
  58.  
  59.    Better look at the size of the BitMap in your RastPort. That is, under
  60. v39 and up use GetBitMapAttr() to query width and height and submit this data
  61. to AllocRaster(), under v37 and below look into BitMap->BytesPerRow and
  62. multiply with eight and BitMap->Rows, respectively.
  63.  
  64. --
  65. Home: Olaf Barthel, Brabeckstrasse 35, D-30559 Hannover
  66.  Net: olsen@sourcery.han.de
  67.